package cate.game.role.bag.heropart.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBBag;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "自选碎片数量合成自选英雄 的 请求")
@OperationSetter(value = GDOperation.FRAGMENT_COMPOSITE, sub = "id")
public class HeroPartChooseNumCompositeReq implements MsgInput {

    @NoteField(value = "碎片id")
    public int id;

    @NoteField(value = "英雄tid")
    public int tid;

    @NoteField(value = "合成数量")
    public int num;

    @NoteField(value = "合成规则")
    public int rule;

    @Override
    public MsgConfig conf() {
        return MsgIdBBag.HERO_PART_CHOOSE_NUM_COMPOSITE_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        cc.getRole().getBag().heroPart.chooseFreeComposite(id, tid, num, rule);
    }
}
